
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> - 登录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">
    <!-- 加上此句话解决360浏览器打开页面后不停刷新的问题
        360打开后会选择兼容模式打开页面,从而使ie内核判断小于9的表达式为true,导致行代码中判断为ie小于9的时候的无限刷新生效
            加上此段代码<meta name="renderer" content="webkit">
            或者删除<meta http-equiv="refresh" content="0;ie.html" />
     -->
    <!-- 使用chrome内核渲染 -->
    <meta name="renderer" content="webkit">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">h</h1>

            </div>
            <h3>欢迎使用 学生信息管理系统</h3>

            <form class="m-t" role="form">
                <div class="form-group">
                    <input type="text" class="form-control" id="txtUserName" placeholder="用户名" required="">
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" id="txtUserPWD" placeholder="密码" required="">
                </div>
                <a onclick="doLogin()" class="btn btn-primary block full-width m-b">登 录</a>
            </form>
        </div>
    </div>

    <!-- 全局js -->
    <script src="js/jquery.min.js?v=2.1.4"></script>
    <script src="js/bootstrap.min.js?v=3.3.6"></script>
    <script type="text/javascript">
    function doLogin(){
        $.ajax({
            url:'/admin/login',
            method:'post',
            dataType:'json',
            data:{
                userName:$('#txtUserName').val(),
                userPWD:$('#txtUserPWD').val()
            },
            success:function(res){
                if(res.status == 'y'){
                    window.location.href = '/admin/main'
                }
                else{
                    alert(res.msg)
                }
            },
            error:function(err){
                console.dir(err)
                alert('服务器内部错误')
            }
        })
    }
    </script>

</body>

</html>
